/*
 * @Author: silence silence9685@163.com
 * @Date: 2023-07-20 15:18:39
 * @LastEditors: silence silence9685@163.com
 * @LastEditTime: 2023-07-20 17:34:37
 * @FilePath: \ems_neutral_app\lib\pages\Login\View\LoginRegisterItem.dart
 * @Description: 登录模块-底部富文本
 */
import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart';
import 'package:sil_base_widget_package/sil_base_widget_package.dart';

import '../../../utils/color/ColorUtils.dart';

class LoginRichTextView extends StatelessWidget {
  final EdgeInsetsGeometry? margin;
  final String? leftTitle;
  final String? rightTitle;
  final void Function()? onTap;
  const LoginRichTextView(
      {this.margin, this.leftTitle, this.rightTitle, this.onTap, super.key});

  Widget build(BuildContext context) {
    return Container(
      margin: this.margin ?? EdgeInsets.symmetric(vertical: 30.w),
      alignment: Alignment.center,
      child: RichText(
          text: TextSpan(children: [
        TextSpan(
            text: this.leftTitle,
            style:
                TextStyle(color: ColorUtils.color_subtitle, fontSize: 14.sp)),
        TextSpan(
          text: this.rightTitle,
          style: TextStyle(color: ColorUtils.color_theme, fontSize: 14.sp),
          recognizer: TapGestureRecognizer()..onTap = this.onTap,
        ),
      ])),
    );
  }
}
